package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum ValidStatusEnum {

    DISABLE(0, "禁用"),
    ENABLE( 1, "启用"),
    ;

    private final Integer key;
    private final String desc;

    ValidStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static ValidStatusEnum getByKey(Integer _key){
        for (ValidStatusEnum item : ValidStatusEnum.values()){
            if(Objects.equals(item.getKey(), _key)){
                return item;
            }
        }
        return null;
    }

}
